package com.nullpointer.idlegame.scene;

import com.nullpointer.idlegame.GlobalContent;
import com.nullpointer.idlegame.service.properties.CommonValue;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.VBox;
import javafx.scene.text.Font;
import javafx.scene.text.Text;

/**
 * 欢迎页
 */
public class ToPage implements CommonScene {

    private CommonValue commonValue = GlobalContent.getMainService().getCommonValue();

    private Scene instance = null;


    @Override
    public Scene init() {
        Text text = new Text();
        text.setText("to page!");
        text.setFont(new Font(40));

        Button btn5 = new Button("to page");
        btn5.setOnMousePressed((MouseEvent mouseEvent) -> {
            WelcomePage page = new WelcomePage();
            GlobalContent.getBasicStage().setScene(page.init());
        });

        this.instance = new Scene(new VBox(text, btn5), 1200, 800);

        return this.instance;
    }

    public Scene getInstance() {
        return instance;
    }
}
